package com.fs.sys.entityservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fs.sys.bean.dto.RoleAppDTO;
import com.fs.sys.bean.query.RoleAppQuery;
import com.fs.sys.domain.entity.RoleAppEntity;
import com.fs.sys.domain.mapper.RoleAppMapper;
import com.fs.sys.entityservice.RoleAppEntityService;
import com.fs.common.base.service.AbstractSimpleEntityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 角色应用关系服务实现 
 * @author Coder Generator 2025-06-10 10:58:46 
 **/
@Service
public class RoleAppEntityServiceImpl extends AbstractSimpleEntityService<RoleAppEntity, RoleAppDTO, RoleAppMapper, RoleAppQuery> implements RoleAppEntityService {
    @Override
    protected QueryWrapper<RoleAppEntity> queryToWrapper(RoleAppQuery query) {
        return this.createQueryWrapper()
                .eq(StringUtils.isNotBlank(query.getId()), "id", query.getId())
                .eq(StringUtils.isNotBlank(query.getAppId()), "app_id", query.getAppId())
                .eq(StringUtils.isNotBlank(query.getRoleId()), "role_id", query.getRoleId())
                .in(null != query.getIds(), "id", query.getIds());
    }
}